<template>
  <div>
    <a-card :bordered="false">
      <f-search-form :more="false" @searchHandler="searchHandler">
        <!-- <f-search-form-item label="主键" name="purchaseorderId"/> -->
        <f-search-form-item label="采购订单号" name="purchaseorderNo"/>
        <f-search-form-item label="订单类型" name="purchaseorderType"/>
        <!-- <f-search-form-item label="订单号" name="erppurchaseOrderno"/> -->
        <!-- <f-search-form-item label="订单日期" name="purchaseorderTime"/>
        <f-search-form-item label="采购组织名称" name="purchasingOrgName"/>
        <f-search-form-item label="供应商编码" name="vendorCode"/>
        <f-search-form-item label="供应商名称" name="vendorName"/>
        <f-search-form-item label="公司编码" name="companyCode"/>
        <f-search-form-item label="公司名称" name="companyName"/>
        <f-search-form-item label="货币编码" name="currencyCode"/>
        <f-search-form-item label="货币名称" name="currencyName"/>
        <f-search-form-item label="货币汇率" name="currencyRate"/>
        <f-search-form-item label="订单金额" name="totalAmount"/>
        <f-search-form-item label="附件ID" name="uploadfileGroupId"/>
        <f-search-form-item label="订单状态" name="purchaseorderState"/>
        <f-search-form-item label="审核状态" name="purchaseorderFlowState"/>
        <f-search-form-item label="流程状态" name="purchaseorderCheckState"/>
        <f-search-form-item label="ERP同步标识" name="erpSynState"/>
        <f-search-form-item label="创建方式" name="createType"/>
        <f-search-form-item label="供应商查看标识" name="viewFlag"/>
        <f-search-form-item label="ERP返回信息" name="erpReturnMsg"/>
        <f-search-form-item label="先确认后审核标识" name="checkFirst"/>
        <f-search-form-item label="isViewPriceFlag" name="isViewPriceFlag"/>
        <f-search-form-item label="客户端编码" name="clientCode"/>
        <f-search-form-item label="备注" name="remark"/>
        <f-search-form-item label="创建人ID" name="createId"/>
        <f-search-form-item label="创建人姓名" name="createName"/>
        <f-search-form-item label="创建时间" name="createTime"/>
        <f-search-form-item label="更新人ID" name="modifyId"/>
        <f-search-form-item label="更新人姓名" name="modifyName"/>
        <f-search-form-item label="更新时间" name="modifyTime"/>
        <f-search-form-item label="采购组编码" name="purchasingGroupCode"/>
        <f-search-form-item label="采购组名称" name="purchasingGroupName"/>
        <f-search-form-item label="供应商编码ERP" name="vendorerpCode"/>
        <f-search-form-item label="供应商可查看标识" name="isvendorView"/>
        <f-search-form-item label="已收货量" name="receiveQty"/>
        <f-search-form-item label="可送数量" name="cansendQty"/>
        <f-search-form-item label="是否撤销审批" name="isrevocationCheck"/>
        <f-search-form-item label="采购组织" name="purchasingorgCode"/>
        <f-search-form-item label="返回值" name="returnValue"/>
        <f-search-form-item label="供应商确认时间" name="vendorconfirmTime"/>
        <f-search-form-item label="国际贸易术语" name="internationlRradeterm"/>
        <f-search-form-item label="国际评论" name="internationlRradeRemark"/>
        <f-search-form-item label="税率编码" name="taxrateCode"/>
        <f-search-form-item label="订单发布时间" name="orderReleaseTime"/>
        <f-search-form-item label="是否紧急" name="urgent"/>
        <f-search-form-item label="合同编码" name="contractNo"/>
        <f-search-form-item label="合同名称" name="contractName"/>
        <f-search-form-item label="项目编码" name="projectNo"/>
        <f-search-form-item label="项目名称" name="projectName"/>
        <f-search-form-item label="工程包号" name="engineeringNo"/>
        <f-search-form-item label="联系人" name="contacts"/>
        <f-search-form-item label="联系人电话" name="contactPhone"/>
        <f-search-form-item label="税率" name="taxrateValue"/>
        <f-search-form-item label="交货地点" name="deliveryPlace"/>
        <f-search-form-item label="代购商id" name="vendoragentId"/>
        <f-search-form-item label="代购商编码" name="vendoragentCode"/>
        <f-search-form-item label="代购商名称" name="vendoragentName"/>
        <f-search-form-item label="项目材料员" name="projectStuffer"/>
        <f-search-form-item label="材料员邮箱" name="projectStufferMail"/>
        <f-search-form-item label="材料员联系电话" name="projectStufferPhone"/>
        <f-search-form-item label="指定收货人" name="receiver"/>
        <f-search-form-item label="收货人邮箱" name="receiverMail"/>
        <f-search-form-item label="收货人联系电话" name="receiverPhone"/>
        <f-search-form-item label="预算总金额" name="budgetAmount"/>
        <f-search-form-item label="承诺占用金额" name="promiseAmount"/>
        <f-search-form-item label="实际成本金额" name="actualAmount"/>
        <f-search-form-item label="累计变更未税金额" name="changeAmount"/>
        <f-search-form-item label="合同总金额" name="contractAmount"/>
        <f-search-form-item label="折扣总金额" name="otherCharge"/>
        <f-search-form-item label="折扣总金额" name="discountAmount"/>
        <f-search-form-item label="付款条件编码" name="paymenttypeCode"/>
        <f-search-form-item label="付款条件名称" name="paymenttypeName"/>
        <f-search-form-item label="需求申请人编码" name="proposerCode"/>
        <f-search-form-item label="需求申请人" name="proposer"/>
        <f-search-form-item label="订购比例%" name="subScriptionRatio"/>
        <f-search-form-item label="工作范围" name="workingScope"/>
        <f-search-form-item label="施工周期" name="constructionPeriod"/>
        <f-search-form-item label="指定收货人" name="receiverCode"/>
        <f-search-form-item label="项目材料员编码" name="projectStufferCode"/>
        <f-search-form-item label="采购员" name="purchaseuserName"/>
        <f-search-form-item label="采购员ID" name="purchaseuserId"/>
        <f-search-form-item label="是否有合同编码标识" name="contractNoflag"/>
        <f-search-form-item label="已有订购金额" name="subScription"/>
        <f-search-form-item label="累计变更未税金额" name="changeNotaxAmount"/>
        <f-search-form-item label="合同总金额" name="contractallNotaxAmount"/>
        <f-search-form-item label="订单未税金额" name="orderNotaxAmount"/>
        <f-search-form-item label="auditorIds" name="auditorIds"/>
        <f-search-form-item label="专业分类" name="materialKindCode"/>
        <f-search-form-item label="更新时间" name="updateTime"/> -->
      </f-search-form>
      <f-table ref="table"
      rowKey="undefined"
       :columns="columns" 
      :exportBtn="true" 
      :multiple="true" 
      :operator="operator" :params="queryParam" 
      :api="api.purchaseorder"
      :showSetting="true"
      :showTotal="false"
      :tableColumns="columns">
        <span slot="action" slot-scope="text, record">
          <template>
            <a @click="$refs.drawer.showDrawer(record)">编辑</a>
            <a-divider type="vertical"/>
          </template>
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
            <a-menu slot="overlay">
              <a-menu-item v-if="$auth('table.delete')">
                <a href="javascript:;" @click="$refs.table.del(record)">删除</a>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </f-table>
      <purchaseorder-drawer ref="drawer"></purchaseorder-drawer>
    </a-card>
  </div>
</template>
<script>
  import purchaseorderDrawer from './purchaseorder_drawer.vue'
  import api from './js/api'
  export default {
    name: 'TableList',
    components: {
      purchaseorderDrawer
    },
    data() {
      let me = this
      //操作按钮
      let operator = []
      operator.push({
        name: '添加',
        icon: 'plus',
        that: this,
        handler: function(table, that) {
            that.$refs.drawer.showDrawer()
        }
      })
      operator.push({
        name: '删除',
        icon: 'delete',
        batch: true,
        handler: function(table) {
            table.remove()
        }
      })
      return {
        api:  Object.assign(api, this.api),
        //列表初始化查询参数
        queryParam: {},
        // 表头
        columns: [
          {
            title: '#',
            width: '60',
            align: 'center',
            customRender: (text, record, index) => index + 1
          },
          {
            title: '主键',
            align: 'center',
            dataIndex: 'purchaseorderId'
          },
          {
            title: '采购订单号',
            align: 'center',
            dataIndex: 'purchaseorderNo'
          },
          {
            title: '订单类型',
            align: 'center',
            dataIndex: 'purchaseorderType'
          },
          {
            title: '订单号',
            align: 'center',
            dataIndex: 'erppurchaseOrderno'
          },
          {
            title: '订单日期',
            align: 'center',
            dataIndex: 'purchaseorderTime'
          },
          {
            title: '采购组织名称',
            align: 'center',
            dataIndex: 'purchasingOrgName'
          },
          {
            title: '供应商编码',
            align: 'center',
            dataIndex: 'vendorCode'
          },
          {
            title: '供应商名称',
            align: 'center',
            dataIndex: 'vendorName'
          },
          {
            title: '公司编码',
            align: 'center',
            dataIndex: 'companyCode'
          },
          {
            title: '公司名称',
            align: 'center',
            dataIndex: 'companyName'
          },
          {
            title: '货币编码',
            align: 'center',
            dataIndex: 'currencyCode'
          },
          {
            title: '货币名称',
            align: 'center',
            dataIndex: 'currencyName'
          },
          {
            title: '货币汇率',
            align: 'center',
            dataIndex: 'currencyRate'
          },
          {
            title: '订单金额',
            align: 'center',
            dataIndex: 'totalAmount'
          },
          {
            title: '附件ID',
            align: 'center',
            dataIndex: 'uploadfileGroupId'
          },
          {
            title: '订单状态',
            align: 'center',
            dataIndex: 'purchaseorderState'
          },
          {
            title: '审核状态',
            align: 'center',
            dataIndex: 'purchaseorderFlowState'
          },
          {
            title: '流程状态',
            align: 'center',
            dataIndex: 'purchaseorderCheckState'
          },
          {
            title: 'ERP同步标识',
            align: 'center',
            dataIndex: 'erpSynState'
          },
          {
            title: '创建方式',
            align: 'center',
            dataIndex: 'createType'
          },
          {
            title: '供应商查看标识',
            align: 'center',
            dataIndex: 'viewFlag'
          },
          {
            title: 'ERP返回信息',
            align: 'center',
            dataIndex: 'erpReturnMsg'
          },
          {
            title: '先确认后审核标识',
            align: 'center',
            dataIndex: 'checkFirst'
          },
          {
            title: 'isViewPriceFlag',
            align: 'center',
            dataIndex: 'isViewPriceFlag'
          },
          {
            title: '客户端编码',
            align: 'center',
            dataIndex: 'clientCode'
          },
          {
            title: '备注',
            align: 'center',
            dataIndex: 'remark'
          },
          {
            title: '创建人ID',
            align: 'center',
            dataIndex: 'createId'
          },
          {
            title: '创建人姓名',
            align: 'center',
            dataIndex: 'createName'
          },
          {
            title: '创建时间',
            align: 'center',
            dataIndex: 'createTime'
          },
          {
            title: '更新人ID',
            align: 'center',
            dataIndex: 'modifyId'
          },
          {
            title: '更新人姓名',
            align: 'center',
            dataIndex: 'modifyName'
          },
          {
            title: '更新时间',
            align: 'center',
            dataIndex: 'modifyTime'
          },
          {
            title: '采购组编码',
            align: 'center',
            dataIndex: 'purchasingGroupCode'
          },
          {
            title: '采购组名称',
            align: 'center',
            dataIndex: 'purchasingGroupName'
          },
          {
            title: '供应商编码ERP',
            align: 'center',
            dataIndex: 'vendorerpCode'
          },
          {
            title: '供应商可查看标识',
            align: 'center',
            dataIndex: 'isvendorView'
          },
          {
            title: '已收货量',
            align: 'center',
            dataIndex: 'receiveQty'
          },
          {
            title: '可送数量',
            align: 'center',
            dataIndex: 'cansendQty'
          },
          {
            title: '是否撤销审批',
            align: 'center',
            dataIndex: 'isrevocationCheck'
          },
          {
            title: '采购组织',
            align: 'center',
            dataIndex: 'purchasingorgCode'
          },
          {
            title: '返回值',
            align: 'center',
            dataIndex: 'returnValue'
          },
          {
            title: '供应商确认时间',
            align: 'center',
            dataIndex: 'vendorconfirmTime'
          },
          {
            title: '国际贸易术语',
            align: 'center',
            dataIndex: 'internationlRradeterm'
          },
          {
            title: '国际评论',
            align: 'center',
            dataIndex: 'internationlRradeRemark'
          },
          {
            title: '税率编码',
            align: 'center',
            dataIndex: 'taxrateCode'
          },
          {
            title: '订单发布时间',
            align: 'center',
            dataIndex: 'orderReleaseTime'
          },
          {
            title: '是否紧急',
            align: 'center',
            dataIndex: 'urgent'
          },
          {
            title: '合同编码',
            align: 'center',
            dataIndex: 'contractNo'
          },
          {
            title: '合同名称',
            align: 'center',
            dataIndex: 'contractName'
          },
          {
            title: '项目编码',
            align: 'center',
            dataIndex: 'projectNo'
          },
          {
            title: '项目名称',
            align: 'center',
            dataIndex: 'projectName'
          },
          {
            title: '工程包号',
            align: 'center',
            dataIndex: 'engineeringNo'
          },
          {
            title: '联系人',
            align: 'center',
            dataIndex: 'contacts'
          },
          {
            title: '联系人电话',
            align: 'center',
            dataIndex: 'contactPhone'
          },
          {
            title: '税率',
            align: 'center',
            dataIndex: 'taxrateValue'
          },
          {
            title: '交货地点',
            align: 'center',
            dataIndex: 'deliveryPlace'
          },
          {
            title: '代购商id',
            align: 'center',
            dataIndex: 'vendoragentId'
          },
          {
            title: '代购商编码',
            align: 'center',
            dataIndex: 'vendoragentCode'
          },
          {
            title: '代购商名称',
            align: 'center',
            dataIndex: 'vendoragentName'
          },
          {
            title: '项目材料员',
            align: 'center',
            dataIndex: 'projectStuffer'
          },
          {
            title: '材料员邮箱',
            align: 'center',
            dataIndex: 'projectStufferMail'
          },
          {
            title: '材料员联系电话',
            align: 'center',
            dataIndex: 'projectStufferPhone'
          },
          {
            title: '指定收货人',
            align: 'center',
            dataIndex: 'receiver'
          },
          {
            title: '收货人邮箱',
            align: 'center',
            dataIndex: 'receiverMail'
          },
          {
            title: '收货人联系电话',
            align: 'center',
            dataIndex: 'receiverPhone'
          },
          {
            title: '预算总金额',
            align: 'center',
            dataIndex: 'budgetAmount'
          },
          {
            title: '承诺占用金额',
            align: 'center',
            dataIndex: 'promiseAmount'
          },
          {
            title: '实际成本金额',
            align: 'center',
            dataIndex: 'actualAmount'
          },
          {
            title: '累计变更未税金额',
            align: 'center',
            dataIndex: 'changeAmount'
          },
          {
            title: '合同总金额',
            align: 'center',
            dataIndex: 'contractAmount'
          },
          {
            title: '折扣总金额',
            align: 'center',
            dataIndex: 'otherCharge'
          },
          {
            title: '折扣总金额',
            align: 'center',
            dataIndex: 'discountAmount'
          },
          {
            title: '付款条件编码',
            align: 'center',
            dataIndex: 'paymenttypeCode'
          },
          {
            title: '付款条件名称',
            align: 'center',
            dataIndex: 'paymenttypeName'
          },
          {
            title: '需求申请人编码',
            align: 'center',
            dataIndex: 'proposerCode'
          },
          {
            title: '需求申请人',
            align: 'center',
            dataIndex: 'proposer'
          },
          {
            title: '订购比例%',
            align: 'center',
            dataIndex: 'subScriptionRatio'
          },
          {
            title: '工作范围',
            align: 'center',
            dataIndex: 'workingScope'
          },
          {
            title: '施工周期',
            align: 'center',
            dataIndex: 'constructionPeriod'
          },
          {
            title: '指定收货人',
            align: 'center',
            dataIndex: 'receiverCode'
          },
          {
            title: '项目材料员编码',
            align: 'center',
            dataIndex: 'projectStufferCode'
          },
          {
            title: '采购员',
            align: 'center',
            dataIndex: 'purchaseuserName'
          },
          {
            title: '采购员ID',
            align: 'center',
            dataIndex: 'purchaseuserId'
          },
          {
            title: '是否有合同编码标识',
            align: 'center',
            dataIndex: 'contractNoflag'
          },
          {
            title: '已有订购金额',
            align: 'center',
            dataIndex: 'subScription'
          },
          {
            title: '累计变更未税金额',
            align: 'center',
            dataIndex: 'changeNotaxAmount'
          },
          {
            title: '合同总金额',
            align: 'center',
            dataIndex: 'contractallNotaxAmount'
          },
          {
            title: '订单未税金额',
            align: 'center',
            dataIndex: 'orderNotaxAmount'
          },
          {
            title: 'auditorIds',
            align: 'center',
            dataIndex: 'auditorIds'
          },
          {
            title: '专业分类',
            align: 'center',
            dataIndex: 'materialKindCode'
          },
          {
            title: '更新时间',
            align: 'center',
            dataIndex: 'updateTime'
          },
          {
            title: '操作',
            align: 'center',
            scopedSlots: { customRender: 'action' }
          }
        ],
        operator: operator
      }
    },
    created() {
    },
    methods: {
    }
  }
</script>
